/**
 * main.cpp
 *
 *  @date 20-okt-2009
 *      Author: eclipse
 */
#include "application.h"
#include "SDLApplication.h"
#include "SDLException.h"
#include <exception>
#include <iostream>

using si::Application;
using si_sdl::SDLApplication;

#define _DEBUG

int main(int argc, char* argv[])
{
#ifndef _DEBUG
	try
	{
#endif
		Application* theApp = new SDLApplication();
		theApp->loop();

		delete theApp;
		return 0;
#ifndef _DEBUG
	}
	catch(std::exception& e)
	{
		std::cerr << "\nEXPECTED (sort of) TERMINAL UNRECOVERABLE ERROR THINGIE\n"
				<< e.what();
	}
	catch(...)
	{
		std::cerr << "\nUNEXPECTED TERMINAL UNRECOVERABLE ERROR THINGIE\n"
			<< "Something really bad that shouldn't have happened "
			<< "has just happened. Take your kids to the shelter and "
			<< "pray for your lives. Because this just might be the end."
			<< "Probably not though..."
			<< "\n";
	}
#endif
}
